import data from '@emoji-mart/data';
import Picker from '@emoji-mart/react';
import React from 'react';
import './custom.css';

interface Props {
  onEmojiSelect: (val: string) => void;
}

const MyEmojiPicker: React.FC<Props> = (props) => {
  const { onEmojiSelect } = props;
  return (
    <Picker
      data={data}
      onEmojiSelect={(val: any) => {
        onEmojiSelect(val.native);
      }}
      locale={'zh'}
      previewPosition={'none'}
      searchPosition={'none'}
    />
  );
};

export default MyEmojiPicker;
